import request from "@/util/request";
import {post} from "axios";

export default {
    // 查询所有
    findAllSpecification(){
        return request({
            url:"/specification/list",
            method:"get"
        })
    },
    //分页查询
    findByPage(page,pageSize){
        return request({
            url:`/specification/findByPage/${page}/${pageSize}`,
            method:"get"
        })
    },
    //分页+条件查询
    search(page,pageSize,data){
        return request({
            url:`/specification/search/${page}/${pageSize}`,
            method:"post",
            data
        })
    },
    //添加
    add(specName,specificationOption){
        return request({
            url:'/specification/add.do',
            method:'post',
            headers,
            params:{
                specName,
            },
            data:specificationOption
        })
    },
    //保存
    save(url,data){
        return request(
            {
                url,
                method:"post",
                data
            }
        )
    },

    //删除
    delete(ids){
        return request(
            {
                url:`/specification/delete/${id}`,
                method:"delete"
            }
        )
    }

}
